#ifndef GETHASH_H
#define GETHASH_H

#include <QWidget>

const int HASH_SIZE = 64;

namespace Ui {
class GetHash;
}

class GetHash : public QWidget
{
    Q_OBJECT

public:
    explicit GetHash(QWidget *parent = 0);
    ~GetHash();

private slots:
    void on_pushButtonBrowse_clicked();

    void on_pushButtonGetHash_clicked();

    void on_pushButtonSelfTest_clicked();

    void on_pushButtonSave_clicked();

private:
    void showInfo(QString info);

    void AddModulo512(const unsigned char *a,const unsigned char *b,unsigned char *c);
    void AddXor512(const void *a,const void *b,void *c);
    void S(unsigned char *state);
    void L(unsigned char *state);
    void P(unsigned char *state);
    void KeySchedule(unsigned char *K,int i);
    void E(unsigned char *K,const unsigned char *m, unsigned char *state);
    void g_N(const unsigned char *N,unsigned char *h,const unsigned char *m);
    void hash_X(unsigned char *IV,const unsigned char *message,unsigned long long length,unsigned char *out);

    void hash_512(const unsigned char *message,unsigned long long length,unsigned char *hash_);
    void hash_256(const unsigned char *message,unsigned long long length,unsigned char *hash_);

    Ui::GetHash *ui;
    unsigned char hash_[HASH_SIZE];
};

#endif // GETHASH_H
